package cn.cvs.entity;

import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

//'拍卖品'
public class Auction {
    private int auctionId;                  //拍卖品编号
    private String auctionName;             //拍卖品名称
    private int auctionStartPrice;       //'拍卖品起拍价'
    private int auctionUpset;            //拍卖品底价
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date auctionStartTime;          //'拍卖品拍卖开始时间'
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date auctionEndTime;            //拍卖品拍卖结束时间
    private String auctionPic;              //拍卖品图片路径
    private String auctionPicType;          //拍卖品图片扩展名
    private String auctionDesc;             //'拍卖品描述'


    /* 额外属性 */
    private String auctionStartTime2;          //'拍卖品拍卖开始时间'   条件
    private String auctionEndTime2;            //拍卖品拍卖结束时间     条件

    private int index;   //页索引
    private int pageSize;    //页大小

    private int auctionRecords;   //该商品的竞拍次数

    private List<Auctionrecord> record;   //拍卖结束的买家
    private int moneyMax;     //拍卖金额
    private String userName;

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public List<Auctionrecord> getRecord() {
        return record;
    }

    public void setRecord(List<Auctionrecord> record) {
        this.record = record;
    }

    public int getMoneyMax() {
        return moneyMax;
    }

    public void setMoneyMax(int moneyMax) {
        this.moneyMax = moneyMax;
    }



    public int getAuctionRecords() {
        return auctionRecords;
    }

    public void setAuctionRecords(int auctionRecords) {
        this.auctionRecords = auctionRecords;
    }

    public String getAuctionStartTime2() {
        return auctionStartTime2;
    }

    public void setAuctionStartTime2(String auctionStartTime2) {
        this.auctionStartTime2 = auctionStartTime2;
    }

    public String getAuctionEndTime2() {
        return auctionEndTime2;
    }

    public void setAuctionEndTime2(String auctionEndTime2) {
        this.auctionEndTime2 = auctionEndTime2;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    /* ************************************************ */

    @Override
    public String toString() {
        return "Auction{" +
                "auctionId=" + auctionId +
                ", auctionName='" + auctionName + '\'' +
                ", auctionStartPrice=" + auctionStartPrice +
                ", auctionUpset=" + auctionUpset +
                ", auctionStartTime=" + auctionStartTime +
                ", auctionEndTime=" + auctionEndTime +
                ", auctionPic='" + auctionPic + '\'' +
                ", auctionPicType='" + auctionPicType + '\'' +
                ", auctionDesc='" + auctionDesc + '\'' +
                ", auctionStartTime2='" + auctionStartTime2 + '\'' +
                ", auctionEndTime2='" + auctionEndTime2 + '\'' +
                ", index=" + index +
                ", pageSize=" + pageSize +
                ", auctionRecords=" + auctionRecords +
                '}';
    }

    public Auction(int auctionId, String auctionName, int auctionStartPrice, int auctionUpset, Date auctionStartTime, Date auctionEndTime, String auctionPic, String auctionPicType, String auctionDesc, String auctionStartTime2, String auctionEndTime2, int index, int size) {
        this.auctionId = auctionId;
        this.auctionName = auctionName;
        this.auctionStartPrice = auctionStartPrice;
        this.auctionUpset = auctionUpset;
        this.auctionStartTime = auctionStartTime;
        this.auctionEndTime = auctionEndTime;
        this.auctionPic = auctionPic;
        this.auctionPicType = auctionPicType;
        this.auctionDesc = auctionDesc;
        this.auctionStartTime2 = auctionStartTime2;
        this.auctionEndTime2 = auctionEndTime2;
        this.index = index;
        this.pageSize = size;
    }

    public Auction() {
    }

    public int getAuctionId() {
        return auctionId;
    }

    public void setAuctionId(int auctionId) {
        this.auctionId = auctionId;
    }

    public String getAuctionName() {
        return auctionName;
    }

    public void setAuctionName(String auctionName) {
        this.auctionName = auctionName;
    }

    public int getAuctionStartPrice() {
        return auctionStartPrice;
    }

    public void setAuctionStartPrice(int auctionStartPrice) {
        this.auctionStartPrice = auctionStartPrice;
    }

    public int getAuctionUpset() {
        return auctionUpset;
    }

    public void setAuctionUpset(int auctionUpset) {
        this.auctionUpset = auctionUpset;
    }

    public String getAuctionPic() {
        return auctionPic;
    }

    public void setAuctionPic(String auctionPic) {
        this.auctionPic = auctionPic;
    }

    public String getAuctionPicType() {
        return auctionPicType;
    }

    public void setAuctionPicType(String auctionPicType) {
        this.auctionPicType = auctionPicType;
    }

    public String getAuctionDesc() {
        return auctionDesc;
    }

    public void setAuctionDesc(String auctionDesc) {
        this.auctionDesc = auctionDesc;
    }

    //*********

    public Date getAuctionStartTime() {
        return auctionStartTime;
    }

    public void setAuctionStartTime(Date auctionStartTime) {
        this.auctionStartTime = auctionStartTime;
    }

    public Date getAuctionEndTime() {
        return auctionEndTime;
    }

    public void setAuctionEndTime(Date auctionEndTime) {
        this.auctionEndTime = auctionEndTime;
    }

    /*public Date getAuctionStartTime() {
        return auctionStartTime;
    }

    public void setAuctionStartTime(String auctionStartTime) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date das1 = null;
        try {
            das1 = sdf.parse(auctionStartTime);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        this.auctionStartTime = das1;
    }

    public Date getAuctionEndTime() {
        return auctionEndTime;
    }

    public void setAuctionEndTime(String auctionEndTime) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date das2 = null;
        try {
            das2 = sdf.parse(auctionEndTime);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        this.auctionEndTime = das2;
    }*/
}
